#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int ni(int t)
{
	int sum = 0;
	while (t)
	{
		sum = sum * 10 + t % 10;
		t /= 10;
	}
	return sum;
}
int main()
{
	int t = 0;
	scanf("%d", &t);
	while (t--)
	{
		int n = 0;
		int m = 0;
		scanf("%d %d", &n, &m);
		int sum = ni(ni(n) + ni(m));
		printf("%d\n", sum);
	}



	return 0;
}

